<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>basic</title>
</head>
<body>
    <div>
        <h1>变量输出</h1>
        hello,{{user.name}}
        Price:{{price|round(2)}}
        <h1>控制结构</h1>
        {% if user.is_admin %}
        <button>删除</button>
        {% elif user.is_editor %}
        <button>编辑</button>
        {% else %}
        <button>查看</button>
        {% endif %}
        <h1>循环</h1>
        <ul>
            {% for item in items%}
            <li>{{loop.index}}:{{item.name}}</li>
            {% endfor %}
        </ul>
    </div>
</body>
</html>